package beikai.com.assistant.controller;


import beikai.com.assistant.common.domain.params.UserParams;
import beikai.com.assistant.service.IUserService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author beikai
 * @since 2021-12-19
 */
@RestController
@RequestMapping("/user/user-model")
public class UserController {
    @Autowired
    private IUserService userService;

    @PostMapping("/login")
    public JSONObject login(@RequestBody UserParams params){
        return userService.login(params);
    }

    @PostMapping("/register")
    public JSONObject register(@RequestBody UserParams params){
        return userService.register(params);
    }

    @PostMapping("/list")
    public JSONObject list(@RequestBody UserParams params){
        return userService.list(params);
    }


}

